<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    <script src="../js/vue.min.js"></script>
</head>
<body>
<div id="app">
    <select v-model="selected">
        <option v-for="option in options" v-bind:value="option.value">
            {{ option.text }}
        </option>
    </select>
    <span @click="clickme">选中项值: {{ selected }}</span>
</div>
<!-- JavaScript 代码需要放在尾部（指定的HTML元素之后） -->
<script>
    new Vue({
        el: '#app',
        data: {
            selected: '2',
            options: [
                { text: '菜单一', value: '1' },
                { text: '菜单二', value: '2' },
                { text: '菜单三', value: '3' }
            ]
        },
        mounted:function(){
            this.selected='1'
        },
        methods: {
            clickme: function () {
                this.selected='3'
            }
        }
    })
</script>
</body>
</html>
